<!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8">
  <title>测试</title>
  <meta name="author" content="Yanyuetian">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1, target-densitydpi=medium-dpi, user-scalable=no">
  <meta property="og:site_name" content="测试"/>
    <script src="zepto.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(function () {
    //alert("alert from js");
        //HostApp.alert("HostApp ready now");
    });
</script>
 <style>
      .entry{
          -webkit-padding-start: 30px;
      }
      .entry li {
          line-height: 29px;
          margin-left: -10px;
      }
      .entry li div{
          margin-right: 10px;
          padding-left: 8px;
          padding-top: 8px;
          padding-bottom: 8px;
          background: #222222;
          color: white;
          word-break: break-all;
          -ms-word-wrap: break-word;
          word-wrap: break-word;
          line-height: 15px;
          font-size: 10pt;
      }
      .entry li button{
          margin-top: 5px;
          width: 60px;
          height: 35px;
          color: #111111;
      }
  </style>
</head>

<body>
<div class="blog-header">
<h3 >Java Interface 可用接口列表测试</h3>
</div>
<h4 >Java Interface Sql服务测试</h4>
<ul class="entry">
    <li>
        Sql服务测试,返回行集，同步<br/>
        <div>
            HostApp.toast(HostApp._executeTask({'type':'sql','data':{'alias':'项目查询','criteria':{'condition':'1=1'},'pageNo':-1,'pageSize':-1}}));
        </div>
        <button onclick="HostApp.toast(
		HostApp._executeTask(
		{'type':'sql','data':{'alias':'项目查询','criteria':{'condition':'1=1'},'pageNo':-1,'pageSize':-1}}
		));">测试</button>
    </li>

    <li>
        Sql服务测试, 返回单行，同步<br/>
        <div>
            HostApp.toast(HostApp._executeTask({'type':'sql','data':{'alias':'项目查询','criteria':{'condition':'1=1'}}}));
        </div>
        <button onclick="HostApp.toast(
		HostApp._executeTask(
		{'type':'sql','data':{'alias':'项目查询','criteria':{'condition':'1=1'}}}
		));">测试</button>
    </li>

    <li>
        Sql服务测试，异步<br/>
        <div>
            HostApp._executeAsyncTask({'type':'sql','data':{'alias':'项目查询','criteria':{'condition':'1=1'},'pageNo':-1,'pageSize':-1}}, 
			function(msg) {
			HostApp.alert(msg.data);
			});
        </div>
        <button onclick="HostApp._executeAsyncTask({'type':'sql','data':{'alias':'项目查询','criteria':{'condition':'1=1'},'pageNo':-1,'pageSize':-1}}, 
		function(msg) {
		HostApp.alert(msg);
		});">测试</button>
    </li>

    <li>
        Sql服务测试, 返回单行，异步<br/>
        <div>
            HostApp.toast(HostApp._executeTask({'type':'sql','data':{'alias':'项目查询','criteria':{'condition':'1=1'}}}));
        </div>
        <button onclick="HostApp._executeAsyncTask({'type':'sql','data':{'alias':'项目查询','criteria':{'condition':'1=1'}}}, 
		function(msg) {
		HostApp.alert(msg);
		});">测试</button>
    </li>
</ul>
<h4 >实体服务测试</h4>
<ul class="entry">
    <li>
        删除实体测试<br/>
        <div>
            HostApp.toast(HostApp._executeTask({'type':'entity','data':{'entity':'param','id':'1','method':'delete'}}));
        </div>
        <button onclick="HostApp.toast(HostApp._executeTask({'type':'entity','data':{'entity':'param','id':'1','method':'delete'}}));">测试</button>
    </li>

    <br/>
    <li>
        Save测试<br/>
        <div>
            HostApp.toast(HostApp._executeTask({'type':'entity','data':{'entity':'param','method':'save',
			'data':
				{
					'name':'asd',
					'f_paramvalues':
					[
						{
							'name':'asd-1',
							'code':'asd-1',
							'f_paramvaluevalues':
							[
								{
									'value':'asd-1-1'
								},
								{
									'value':'asd-1-2'
								}
							]
						},
						{
							'name':'asd-2',
							'f_paramvaluevalues':
							[
								{
									'value':'asd-2-1'
								}
							]
						},
						{
							'name':'asd-3',
						}												
					]
				}
			}}));
        </div>
        <button onclick="HostApp.toast(HostApp._executeTask({'type':'entity','data':{'entity':'param','method':'save', 'data':
				{
					'name':'asd',
					'f_paramvalues':
					[
						{
							'name':'asd-1',
							'code':'asd-1',
							'f_paramvaluevalues':
							[
								{
									'value':'asd-1-1'
								},
								{
									'value':'asd-1-2'
								}
							]
						},
						{
							'name':'asd-2',
							'f_paramvaluevalues':
							[
								{
									'value':'asd-2-1'
								}
							]
						},
						{
							'name':'asd-3',
						}												
					]
				}
		}}));">测试</button>
    </li>

    <br/>
    <li>
        Update测试<br/>
        <div>
            HostApp.toast(HostApp._executeTask({'type':'entity','data':{'entity':'param', 'method':'save',
			'data':
				{
					'id': 'a38d69bb-0a94-477c-abbb-e7b1cda8e6ef',
					'name':'asd0',
					'f_paramvalues':
					[
						{
							'id': '90131fa4-ed20-412e-a79f-9b1166a2d1f3',
							'name':'asd-10',
							'code':'asd-10',
							'f_paramvaluevalues':
							[
								{
									'id': '2c72c5a9-ac11-46fa-abdb-cc5a2fd92700',
									'value':'asd-1-10'
								},
								{
									'id': '0ef93e36-4e6a-4464-8112-a50591e25b69',
									'value':'asd-1-20'
								}
							]
						},
						{
							'id': '6f509f11-9f37-4fbf-90f8-d0c8edf1674e',
							'name':'asd-20',
							'f_paramvaluevalues':
							[
								{
									'id': 'f85fb087-45b2-b99b-3bfc6ba48979',
									'value':'asd-2-10'
								}
							]
						},
						{
							'id': '224687ec-6966-41dc-88fa-08a14bf3ae9d',
							'name':'asd-30',
							'code':'asd-30'
						}												
					]
				}
			}}));
        </div>
        <button onclick="HostApp.toast(HostApp._executeTask({'type':'entity','data':{'entity':'param','method':'save', 'data':
				{
					'id': 'a38d69bb-0a94-477c-abbb-e7b1cda8e6ef',
					'name':'asd0',
					'f_paramvalues':
					[
						{
							'id': '90131fa4-ed20-412e-a79f-9b1166a2d1f3',
							'name':'asd-10',
							'code':'asd-10',
							'f_paramvaluevalues':
							[
								{
									'id': '2c72c5a9-ac11-46fa-abdb-cc5a2fd92700',
									'value':'asd-1-10'
								},
								{
									'id': '0ef93e36-4e6a-4464-8112-a50591e25b69',
									'value':'asd-1-20'
								}
							]
						},
						{
							'id': '6f509f11-9f37-4fbf-90f8-d0c8edf1674e',
							'name':'asd-20',
							'f_paramvaluevalues':
							[
								{
									'id': 'f85fb087-ec58-45b2-b99b-3bfc6ba48979',
									'value':'asd-2-10'
								}
							]
						},
						{
							'id': '224687ec-6966-41dc-88fa-08a14bf3ae9d',
							'name':'asd-30',
							'code':'asd-30'
						}												
					]
				}
		}}));">测试</button>
    </li>
    <br/>
    <li>
        业务测试<br/>
        代码：<br/>
        <div>
            HostApp.toast(HostApp._executeTask({'type':'logic','data':{'alias':'执行SQL','data':{'fname':'asd'}}}));
        </div>
        <button onclick="HostApp.toast(HostApp._executeTask({'type':'logic','data':{'alias':'执行SQL','data':{'fname':'asd'}}}));">测试</button>
    </li>
	<br>
	
   <li>
        rset服务测试<br/>
        代码：<br/>
        <div>
            HostApp.toast(HostApp._executeTask({'type':'rest','data':{'action':'post','url':'http://10.10.151.153:8080/rs/db/meta/','data':'t_task,t_taskdispatch,param,paramvalue,valuevalue'}}));
        </div>
        <button onclick="HostApp.toast(HostApp._executeTask({'type':'rest','data':{'action':'post','url':'http://10.10.151.153:8080/rs/db/meta/','data':'t_task,t_taskdispatch,param,paramvalue,valuevalue'}}));">测试</button>
    </li>
	<br>
	
    <li>
        确认框弹出<br/>
        代码：<br/>
        <div>
            HostApp.alert('我是确认框');
        </div>
        <button onclick="HostApp.alert('我是确认框');">测试</button>
    </li>
<br>
    <li>
        异步回调，传入js函数到Java方法,设定3秒后回调<br/>
        代码：<br/>
        <div>
            HostApp.delayJsCallBack(3, 'call back haha', function (msg) {
                HostApp.alert(msg);
            });
        </div>
        <button onclick="HostApp.delayJsCallBack(3, 'call back haha', function (msg) {HostApp.alert(msg);});">测试</button>
    </li>
<a href="test2.html">go to test2</a>
</body>
</html>
